"""
顺序查找，也叫线性查找

时间复杂度 O(n)
"""


def linear_search(li, value):
    for ind, val in enumerate(li):
        if val == value:
            return ind
    else:
        return None


if __name__ == '__main__':
    li = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
    print(linear_search(li, 8))
